#include <iostream>

int main() {
    int a[3][3] = {1,2,3,4,5,6,7,8,9};
    int *p, i;
    void move(int *pointer);
    p = &a[0][0];
    move(p);
    for (i = 0; i < 3; i++) {
        printf("%d\t %d\t %d \n", a[i][0], a[i][1], a[i][2]);
    }
    printf("\n");
    return 0;
}

void move(int *pointer) {
    int i, j, t;
    for (i = 0; i < 3; i++) {
        for (j = 1; j < 3; j++) {
            t = * (pointer + 3 * i+ j);
            * (pointer + 3 * i+ j) = * (pointer + 3 * j+ i);
            * (pointer + 3 * j+ i) = t;
        }
    }
}